import request from '@/utils/request'

export function downloadExcel(params){
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/Order/excel',
    method: 'get',
    responseType:'blob',
    params,
    timeout:0
  })
}


export function getList(params) {
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/Order/index',
    method: 'get',
    params,
  })
}

export function getCheckUsefulOrderList(params) {
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/useless/checkUsefulOrderList',
    method: 'get',
    params,
  })
}

export function doEdit(data) {
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/Order/edit',
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/Order/del',
    method: 'post',
    data,
  })
}

export function detail(params) {
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/order/detail',
    method: 'get',
    params,
  })
}

export function deliveryOrder(data){
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/order/deliveryOrder',
    method: 'post',
    timeout:3600000,
    data,
  })

}

export function importExpressInfo(data){
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/order/importExpressInfo',
    method: 'post',
    data,
  })
}

//订单发送百度历史记录
export function deliveryList(params) {
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/Order/deliveryList',
    method: 'get',
    params,
  })
}

export function refund(data){
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/Order/refund',
    method: 'post',
    data,
  })

}

export function updateUcName(data){
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/order/updateUcName',
    method: 'post',
    data,
  })
}

export function updateUseless(data){
  return request({
    url: process.env.VUE_APP_BASE_URL+'/admin/useless/edit',
    method: 'post',
    data,
  })
}
